const http = require('http');

let server = http.createServer();

server.on('request', (req, res) => {
    console.log(req.url);
    console.log(req.method);
    console.log(req.httpVersion);
    console.log(req.rawHeaders);
    console.log(req.headers);
    res.writeHead(404, 'Not Found', {'Content-Type': 'text/html;charset=utf8'});
    res.write('req');
    res.end();
});

server.listen(8080, () => {
    console.log('app is listen 8080')
});